package com.milo.observer;

/**
 * @author: MiloLee
 * @create: 2019-07-19 11:19
 * @description: 观察者模式演示
 **/
public class ObserverPatternDemo {
    public static void main(String[] args) throws ClassNotFoundException {
        Subject subject = new Subject();

        new HexaObserver(subject);
        new OctalObserver(subject);
        new BinaryObserver(subject);

        System.out.println("First state change: 15");
        subject.setState(15);
        System.out.println("Second state change: 10");
        subject.setState(10);
    }
}
